/*
 * Copyright 2020 HPB Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hpb.bc.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.hpb.bc.entity.Addrs;
import com.hpb.bc.example.AddrsExample;

public interface AddrsMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    long countByExample(AddrsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int deleteByExample(AddrsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(String address);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int insert(Addrs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int insertSelective(Addrs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    List<Addrs> selectByExample(AddrsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    Addrs selectByPrimaryKey(String address);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") Addrs record, @Param("example") AddrsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") Addrs record, @Param("example") AddrsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(Addrs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(Addrs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table addrs
     *
     * @mbg.generated
     */
    List<Addrs> selectByAddrs(@Param("addrs") Addrs addrs);


    List<Addrs> selectBalanceOrderByAddrs(@Param("addrs") Addrs addrs);

    int selectAddrCount();

    String selectTotalAssetsAmount();

    List<Addrs> selectAddrsOrderByBalanceDesc();

    /**
     * 查询出没有发生转账交易的节点账户
     */
    List<String> selectNodeAddressListWithoutTransaction();


    /**
     * @param accountType 根据账户类型（1），查询智能合约地址；
     */
    List<String> selectContractAddressByAccountType(@Param("accountType") Integer accountType);

    List<Addrs> selectByContractAddrs(@Param("addrs") Addrs addrs);
}